<?php
    class Form_bibliotecario extends Zend_Form {
        
        public function init () {
            $controller = Zend_Controller_Front::getInstance();
            
            $name = $this->createElement('text', 'name');
            $name->addFilter('StringTrim');
            $name->setRequired(TRUE);
            $name->setAttribs(array('class'=>'inputStyle','maxlength'=>'80','order'=>1));
            $name->addErrorMessage("Por favor ingrese el nombre.");
            $this->addElement($name);
            
            $logname = $this->createElement('text', 'logname');
            $logname->addFilter('StringTrim');
            $logname->setRequired(TRUE);
            $logname->setAttribs(array('class'=>'inputStyle','maxlength'=>'30','order'=>2));
            $logname->addErrorMessage("Por favor ingrese el nombre de usuario.");
            $this->addElement($logname);
            
            $passwd = $this->createElement('password', 'passwd');
            $passwd->addFilter('StringTrim');
            $passwd->setRequired(TRUE);
            $passwd->setAttribs(array('class'=>'inputStyle','maxlength'=>'30','order'=>3));
            $passwd->addErrorMessage("Por favor ingrese la contraseña.");
            $this->addElement($passwd);
            
            $stateId = new Zend_Form_Element_Select('roleId');
            $stateId->setRequired(TRUE);
            $stateId->setAttribs(array('order'=>4,'class'=>"listStyle"));
            $stateId->addErrorMessage("Por favor seleecione un rol.");
            $stateId->setRegisterInArrayValidator(false);
            $this->addElement($stateId);
            
            $chkrem = $this->createElement('checkbox', 'chkbloqueado');
            $chkrem->addFilter('StringTrim');
            $chkrem->setAttribs(array('order'=>5,'class'=>"listStyle"));
            $this->addElement($chkrem);
            
            $hidden = $this->createElement('hidden', 'hiddenedit');
            $hidden->setValue("none");
            $this->addElement($hidden); 
            
            $BtnGuardar = $this->createElement('reset', 'BtnCancel');
            $BtnGuardar->setAttribs(array('order'=>6,'class'=>"listStyle", 'onclick'=>'clearForm();'));
            $BtnGuardar->setLabel('Cancelar');
            $this->addElement($BtnGuardar);
            
            $BtnGuardar = $this->createElement('submit', 'BtnGuardar');
            $BtnGuardar->setAttribs(array('order'=>6,'class'=>"listStyle"));
            $BtnGuardar->setLabel('Guardar');
            $this->addElement($BtnGuardar);
            
            $cancel = $this->createElement('reset','cancel', array('Label' =>'Cancel','onclick'=>'closeWin()'));
            $this->addElement($cancel);
            
            $this->setElementDecorators(array(
                array('ViewHelper'),
                array('Errors'),
            ));
        }
    }
?>